package com.yc.cloud.common.basic.annotation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Constraint(validatedBy = DateValidator.class)
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.ANNOTATION_TYPE, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface ValidDate {
    String message() default "日期格式不正确";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};

    // 新增 format 属性
    String format() default "yyyy-MM-dd HH:mm:ss"; // 默认格式
}


